package com.itheima.spring_mvc_xml.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Arrays;
import java.util.Date;

public class User {
    private String name;
    private Integer age;
    private Double income;
    private Boolean isMarry;
    private String[] interests;

    //
    //@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")

    //用来限定时间的格式，以便于可以快速的把json中的时间字符串转换为date对象,以及实现反转
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone = "GMT+8")
    private Date date;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getIncome() {
        return income;
    }

    public void setIncome(Double income) {
        this.income = income;
    }

    public Boolean getIsMarry() {
        return isMarry;
    }

    public void setIsMarry(Boolean isMarry) {
        this.isMarry = isMarry;
    }

    public String[] getInterests() {
        return interests;
    }

    public void setInterests(String[] interests) {
        this.interests = interests;
    }


    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", income=" + income +
                ", isMarry=" + isMarry +
                ", interests=" + Arrays.toString(interests) +
                ", date=" + date +
                '}';
    }
}